<?php
class home extends MY_Controller{
	
	protected $title = "";
	
	function __construct(){
		parent::__construct();
		$this->config->load("raw");
	}
	
	function index(){
		$this->dash();
	}
	
	function dash(){
		$this->title = "Home";
		
		/*
		 * load header
		 * @param load config header first
		 */
		$header = $this->config->item("header");
		$header = $this->load->view("finalizeView/header",$header,true);
		
		/*
		 * load content
		 * @note this content need width lpanel and width rpanel
		 * @param load config content first 
	
		 */
		$content = $this->config->item("content");
		$content['title'] = $this->title;
		$content['w_main'] = "100%";
		
		$limit = 0;
		$offset = 1;
		
			
		$content['rpanel_main'] = $this->load->view("index/dashboard/home","",true);
		$content = $this->load->view("finalizeView/content",$content,true);
		
		
		/*
		 * load footer
		 * @param load config content first
		 */
		$footer = $this->config->item("footer");
		$footer = $this->load->view("finalizeView/footer",$footer,true);
		
		/*
		 * finalize view 
		 * @optional : when need jscript or css ADD jscript and css with js_script() css_script() 
		 * @param config page 
		 * @finalizeView : array(title,jscript_add,css_add,jscript,css,header,content,footer);
		 */
		$jscript = js_script(array("FloatingTips"));
		$css = css_script(array("nav.main","table","body"));
		$page = $this->config->item('page');
		$page['title'] = $page['title']." - ".$this->title;
		$this->finalizeView(array(
			'title' => $page['title'],
			'jscript_add'=>$jscript,
			'css_add'=>$css,
    		'jscript'=>"",
    		'css'=>css_script($page['css_default']),
			'header' => $header,
			'content' => $content,
			'footer' => $footer
		));
	}
    
}